package AccionBoton;

import java.awt.Window;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import paginas.PaginaEntornoCreacionTeclados;
import util.PanelBotonEliminado;

public class AccionSeleccionPanelEliminado implements MouseListener{

	
	private PanelBotonEliminado _boton;
	private PaginaEntornoCreacionTeclados _frame;
	private Window _ventana;
	
	public AccionSeleccionPanelEliminado(PanelBotonEliminado b, PaginaEntornoCreacionTeclados frame, Window ventana){
		
		_boton = b;
		_frame = frame;
		_ventana = ventana;
		
		
	}

	public void mouseClicked(MouseEvent arg0) {

		PanelBotonEliminado old = _frame.getPanelSeleccionado();
		if(old!=null){
		old.deseleccionar();}

		_boton.seleccionar();

		_ventana.pack();
		_ventana.repaint();
		_frame.pack();
		_frame.repaint();
		_frame.setPanelSeleccionado(_boton);
	}

	public void mouseEntered(MouseEvent arg0) {
		
	}

	public void mouseExited(MouseEvent arg0) {
		
	}

	public void mousePressed(MouseEvent arg0) {
		
	}

	public void mouseReleased(MouseEvent arg0) {
		
	}
	
	
}
